<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('purchaser_users', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('purchaser_id')->comment('采购商id');
            $table->string('username')->unique()->comment('用户登录帐号');
            $table->string('name')->unique()->comment('用户姓名');
            $table->unsignedTinyInteger('gender')->default(1)->comment('性别 0 女 1 男');
            $table->string('mobile')->unique()->comment('用户手机号');
            $table->string('avatar')->default('purchaser_user/avatar/default.png')->comment('用户头像');
            $table->string('password')->comment('用户登录密码');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态 0 禁用 1 正常');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('purchaser_users');
    }
};
